# -*- coding:utf-8 -*-
import datetime
now  = datetime.datetime.now()
print int((datetime.datetime(now.year,now.month,now.day,23,59,59) - now).total_seconds())

